﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace OplugFramework.Portal
{
    /// <summary>
    /// Attachment文件附件表
    /// </summary>
    public class Attachment: Entity<Guid>, IHasCreationTime, ICreationAudited, IMustHaveTenant, IHasModificationTime
    {
        public DateTime CreationTime { get; set; }
        public long? CreatorUserId { get; set; }
        public int TenantId { get; set; }
        public DateTime? LastModificationTime { get; set; }
        [Required]
        [MaxLength(50)]
        public string FileName { get; set; }
        /// <summary>
        /// 文件二进制字节流
        /// </summary>
        public byte[] FileData { get; set; }
        /// <summary>
        /// 文件扩展名
        /// </summary>
        [Required]
        [MaxLength(10)]
        public string FileExtension { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        public decimal FileSize { get; set; }
        /// <summary>
        /// 对象名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ObjectName { get; set; }
        /// <summary>
        /// 对象ID
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ObjectId { get; set; }
        [MaxLength(50)]
        public string ObjectField { get; set; }
    }
}
